The 3n + 1 problem
while 1:
try:
a,b=map(int,input().split())
x,y=min(a,b),max(a,b)
maxi=0
for i in range(x,y+1):
count=0
while i!=1:
if i%2==1:
i=3*i+1
else:
i/=2
count+=1
if count>maxi:
maxi=count
print(a,b,maxi+1)
except:
break
You can say 11
while 1:
try:
a=int(input())
if a==0:
break
if a%11==0:
print(str(a)+' is a multiple of 11.')
else:
print(str(a)+' is not a multiple of 11.')
except:
break